/*
	LIS302 accellerator driver header file
	by Rolf Ziegler
	Nov. 2013

*/
#ifndef __LSM303
#define __LSM303

#ifdef SPEEDA
#define DEVICE_WRITE    0x3A //Default LIS302DL I2C address - write
#define DEVICE_READ     0x3B //Default LIS302DL I2C address - read
#else
#define ACCEL    0x30
#define MAGNETO  0x3C

#endif

#include <i2c.h>
#include <delays.h>
#include "typedef.h"

void delayi2c(void);
void lsm303Init(void);
u8 i2cReady(void);
void i2cWriteByte(u8 device,u8 address, u8 data);
u8 i2cReadByte(u8 device,u8 address);
u16 i2cReadWord(u8 device,u8 address);

#endif
////////////////////// end of driver file /////////////////////////////////////
